package com.fuhe.chen.vendingmachine.dao;

import com.fuhe.chen.vendingmachine.pojo.Commodity;
import com.fuhe.chen.vendingmachine.pojo.CommoditySellLabel;
import com.fuhe.chen.vendingmachine.pojo.RelationshipCommodityLabel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommoditySellLabelDao {

    /**
     * 新增标签
     * @param label
     */
    void addLabel(CommoditySellLabel label);

    /**
     * 删除标签
     * @param id
     */
    void deleteLabel(@Param("id") int id);

    /**
     * 绑定商品
     * @param commodityId
     * @param labelId
     */
    void addBindRelationship(Integer commodityId,Integer labelId);

    /**
     * 解除商品绑定
     * @param commodityId
     * @param labelId
     */
    Integer delBindRelationship(Integer commodityId,Integer labelId);


    /**
     * 查询所有
     * @return
     */
    List<CommoditySellLabel> findAll();


    /**
     * 查询单个
     * @return
     */
    CommoditySellLabel findOne(@Param("id") Integer id);


    /**
     * 查询所有关系
     * @return
     */
    List<RelationshipCommodityLabel> findAllRelationship();



}
